#include <stdio.h>

int min(int a, int b)
{
    return a < b ? a : b;
}
#define MIN(a, b) ((a) < (b) ? (a) : (b))

int findmin(int d[], int n)
{
    if (n == 0)
        return d[0];
    else
        return min(d[n-1], findmin(d, n-1));
        //对比一下，这里用min函数和MIN宏的区别
}

int main()
{
    int n, i, d[100];
    scanf("%d", &n);
    for (i = 0; i < n; i++)
        scanf("%d", &d[i]);
    printf("%d\n", findmin(d, n));
    return 0;
}
